package cn.south.campus.business.service;

import cn.south.campus.business.model.entity.Wallet;
import cn.south.campus.business.model.req.WalletReq;
import cn.south.campus.business.model.vo.WalletVo;
import cn.south.campus.business.model.vo.WithdrawalAuditVo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.math.BigDecimal;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/11/14 13:31
 */
public interface WalletService extends IService<Wallet> {

    /**
     * 充值
     *
     * @param walletReq 充值信息
     */
    void recharge(WalletReq walletReq);

    /**
     * 初始化钱包
     *
     * @param id 用户id
     */
    void initWallet(Long id);

    /**
     * 扣款
     *
     * @param amount 扣款金额
     */
    void subtractBalance(BigDecimal amount, Long userId);

    /**
     * 增加余额
     *
     * @param amount 增加金额
     */
    void addBalance(BigDecimal amount, Long userId);

    /**
     * 减少冻结余额，并增加余额
     *
     * @param amount 增加金额
     */
    void subFreezeAddBalance(BigDecimal amount, Long userId);

    /**
     * 增加冻结余额
     *
     * @param amount 增加金额
     */
    void addFreezeBalance(BigDecimal amount, Long userId);
    /**
     * 减少余额增加冻结余额
     *
     * @param amount 增加金额
     */
    void subBalanceAddFreeze(BigDecimal amount, Long userId);

    /**
     * 减少冻结余额
     *
     * @param amount 增加金额
     */
    void subFreezeBalance(BigDecimal amount, Long userId);

    /**
     * 提现
     *
     * @param walletReq 提现信息
     */
    void withdraw(WalletReq walletReq);

    /**
     * 查询余额
     *
     * @return 余额
     */
    WalletVo queryBalance();

    /**
     * 提现回调
     *
     * @param withdrawalAuditVo 提现信息
     */
    void withdrawCallback(WithdrawalAuditVo withdrawalAuditVo);
}
